import { BaseModel } from "./basemodel";

export class Model extends BaseModel {

    constructor(context, collection, x, y, r) {
        super(x, y, r);
        this.context = context;
        this.context.addModel(this, collection);
        this.x = x;
        this.y = y;
        this.r = r;
    }

    registerRepeat() {
        this.context.registerRepeat(this);
    }
    unregisterRepeat() {
        this.context.unregisterRepeat(this);
    }
    registerDrawable() {
        this.context.registerDrawable(this);
    }
    unregisterDrawable() {
        this.context.unregisterDrawable(this);
    }

    repeat() { }
    
    draw(ctx2d) { }

    destroy() {
        this.context.removeModel(this);
        this.unregisterRepeat(this);
        this.unregisterDrawable(this);
    }

}